---@class SkillEffect553100:BaseSkillEffect
SkillEffect553100 = ClientFight.CreateClass("SkillEffect553100",ClientFight.BaseSkillEffect)
local t = SkillEffect553100
---@param skill FightUsingSkill
---@param summon Fighter
function t:summonEnterSceneBefore(skill,summon)
    summon.cooldowns = {}----清空原技能cd
    local target = skill.target

    summon.skillDynamic = target.skillDynamic;--格雷复制的,需要完全继承目标的动态参数
    summon.skillDynamicParam = target.skillDynamicParam;--格雷复制的,需要完全继承目标的动态参数
    summon.buffDynamicParam = target.buffDynamicParam;--格雷复制的,需要完全继承目标的动态参数
    
    local heroBean = target.heroBean
    --改变他的模型
    local modelId = summon.modelId
    summon.heroBean = heroBean
    summon.modelId = target.modelId
    local normalSkillId = target.normalAttack.skillId
    local fight = skill.fight
    summon.normalAttack = SkillManager.createFightSkill(fight, normalSkillId,summon)
    local parameter = skill.skill.skillBean.f_SkillScriptParameter
    local skills = {}
    table.addAllToArr(skills,skill.target.skills)
    table.addAllToArr(skills,skill.target.passiveskills)
    local extType = {}
    for k, _skill in pairs(skills) do
        local continue = false
        if (target.heroBean.f_HeroID== 610 and _skill.skillType==4) then ----西泽,强行继承技能3
        else
            if (not table.contains(parameter, _skill.skillType)) then
                continue = true
            end
        end
        if not continue then
            --继承爸爸的技能
            SkillManager.addSkill(fight, summon, _skill.skillId, _skill.skillType)
            extType[_skill.skillType] = true
        end
    end
    -- 排序

    table.sort(summon.skills,function(o1,o2)
        return o1.skillBean.f_SkillPriority > o2.skillBean.f_SkillPriority
    end)
    if (target.puppet ~= nil) then
        local puppet = FighterManager.createSummonsFighter(fight, skill.fighter, modelId, FighterAiTypeEnum.DAI_BI, SummonsType.ENTITY, nil, 1000);
        puppet.summonsExpireFrame = summon.summonsExpireFrame;
        puppet.lifeFrame = summon.lifeFrame
        puppet.modelId = 611
        summon.puppet = puppet
    end
end
---@param fight Fight
---@param fighter Fighter
---@param skill FightSkill
---@param center Vector2
---@param excludes table<number,boolean>
---@return Fighter
function t:selectAttackTarget( fight, fighter, skill, center,excludes)
    local skillBean = skill.skillBean
    local fighters = fight.teams[3 - fighter.teamIndex].fighters
    excludes = {}
    for k, target in pairs(fighters) do
        if (target.modelId == 55) then
            excludes[target.fighterId] = true;
        end
    end
    local target = SkillManager.selectAttackTarget(fight, fighter, skill, skillBean.f_TargetRange, skillBean.f_Target, skill:getTargetRule(),
    AttackUtils.getAttackRadius(fighter, skill), AttackUtils.getAttackShape(fighter, skill), center, skillBean.f_TagActivate, excludes, false);
    if (target == nil) then
        return FighterManager.emptyFighter;
    end
    return target
end

t.New()